<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__tcpwm__functions__counter.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Functions<div class="ingroups"><a class="el" href="group__group__tcpwm.html">TCPWM        (Timer Counter PWM)</a> &raquo; <a class="el" href="group__group__tcpwm__counter.html">Timer/Counter (TCPWM)</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga6068a06ddc8a07c67bb6df86e920944c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__tcpwm__enums.html#ga236beaba02c8a2a1c4eec981501e7270">cy_en_tcpwm_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#ga6068a06ddc8a07c67bb6df86e920944c">Cy_TCPWM_Counter_Init</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *base, uint32_t cntNum, <a class="el" href="structcy__stc__tcpwm__counter__config__t.html">cy_stc_tcpwm_counter_config_t</a> const *config)</td></tr>
<tr class="memdesc:ga6068a06ddc8a07c67bb6df86e920944c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the counter in the TCPWM block for the Counter operation.  <a href="#ga6068a06ddc8a07c67bb6df86e920944c">More...</a><br /></td></tr>
<tr class="separator:ga6068a06ddc8a07c67bb6df86e920944c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga162b6671930fb1951d6678cc5805dfbb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#ga162b6671930fb1951d6678cc5805dfbb">Cy_TCPWM_Counter_DeInit</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *base, uint32_t cntNum, <a class="el" href="structcy__stc__tcpwm__counter__config__t.html">cy_stc_tcpwm_counter_config_t</a> const *config)</td></tr>
<tr class="memdesc:ga162b6671930fb1951d6678cc5805dfbb"><td class="mdescLeft">&#160;</td><td class="mdescRight">De-initializes the counter in the TCPWM block, returns register values to default.  <a href="#ga162b6671930fb1951d6678cc5805dfbb">More...</a><br /></td></tr>
<tr class="separator:ga162b6671930fb1951d6678cc5805dfbb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1707e2cc291fe486fbea346157c65bff"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#ga1707e2cc291fe486fbea346157c65bff">Cy_TCPWM_Counter_Enable</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *base, uint32_t cntNum)</td></tr>
<tr class="memdesc:ga1707e2cc291fe486fbea346157c65bff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the counter in the TCPWM block for the Counter operation.  <a href="#ga1707e2cc291fe486fbea346157c65bff">More...</a><br /></td></tr>
<tr class="separator:ga1707e2cc291fe486fbea346157c65bff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6edbf345956ab2fce23b5e98c0207ae6"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#ga6edbf345956ab2fce23b5e98c0207ae6">Cy_TCPWM_Counter_Disable</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *base, uint32_t cntNum)</td></tr>
<tr class="memdesc:ga6edbf345956ab2fce23b5e98c0207ae6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables the counter in the TCPWM block.  <a href="#ga6edbf345956ab2fce23b5e98c0207ae6">More...</a><br /></td></tr>
<tr class="separator:ga6edbf345956ab2fce23b5e98c0207ae6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae39af6cd9306eaca090fa62999fd81af"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#gae39af6cd9306eaca090fa62999fd81af">Cy_TCPWM_Counter_GetStatus</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *base, uint32_t cntNum)</td></tr>
<tr class="memdesc:gae39af6cd9306eaca090fa62999fd81af"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the status of the Counter Timer whether it is running or not.  <a href="#gae39af6cd9306eaca090fa62999fd81af">More...</a><br /></td></tr>
<tr class="separator:gae39af6cd9306eaca090fa62999fd81af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga53321a824ba298d75d8bed089bfb4595"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#ga53321a824ba298d75d8bed089bfb4595">Cy_TCPWM_Counter_GetCapture0Val</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *base, uint32_t cntNum)</td></tr>
<tr class="memdesc:ga53321a824ba298d75d8bed089bfb4595"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the capture 0 value when the capture mode is enabled.  <a href="#ga53321a824ba298d75d8bed089bfb4595">More...</a><br /></td></tr>
<tr class="separator:ga53321a824ba298d75d8bed089bfb4595"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabc22432c63203412232182d676caa149"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#gabc22432c63203412232182d676caa149">Cy_TCPWM_Counter_GetCapture0BufVal</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *base, uint32_t cntNum)</td></tr>
<tr class="memdesc:gabc22432c63203412232182d676caa149"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the buffered capture 0 value when the capture mode is enabled.  <a href="#gabc22432c63203412232182d676caa149">More...</a><br /></td></tr>
<tr class="separator:gabc22432c63203412232182d676caa149"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaddb9ccef6ad2fc1af0a87d5929a72ce7"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#gaddb9ccef6ad2fc1af0a87d5929a72ce7">Cy_TCPWM_Counter_SetCompare0Val</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *base, uint32_t cntNum, uint32_t compare0)</td></tr>
<tr class="memdesc:gaddb9ccef6ad2fc1af0a87d5929a72ce7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the compare value for Compare0 when the compare mode is enabled.  <a href="#gaddb9ccef6ad2fc1af0a87d5929a72ce7">More...</a><br /></td></tr>
<tr class="separator:gaddb9ccef6ad2fc1af0a87d5929a72ce7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga21df9e952f046d91ed704a9a452ce837"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#ga21df9e952f046d91ed704a9a452ce837">Cy_TCPWM_Counter_GetCompare0Val</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *base, uint32_t cntNum)</td></tr>
<tr class="memdesc:ga21df9e952f046d91ed704a9a452ce837"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns compare 0 value.  <a href="#ga21df9e952f046d91ed704a9a452ce837">More...</a><br /></td></tr>
<tr class="separator:ga21df9e952f046d91ed704a9a452ce837"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaff1f4c6bdbdbeae956d541909250ad78"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#gaff1f4c6bdbdbeae956d541909250ad78">Cy_TCPWM_Counter_SetCompare0BufVal</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *base, uint32_t cntNum, uint32_t compare1)</td></tr>
<tr class="memdesc:gaff1f4c6bdbdbeae956d541909250ad78"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the compare value for Compare1 when the compare mode is enabled.  <a href="#gaff1f4c6bdbdbeae956d541909250ad78">More...</a><br /></td></tr>
<tr class="separator:gaff1f4c6bdbdbeae956d541909250ad78"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaac74937868fb6ebbdce2c9bc9d2ae541"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#gaac74937868fb6ebbdce2c9bc9d2ae541">Cy_TCPWM_Counter_GetCompare0BufVal</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *base, uint32_t cntNum)</td></tr>
<tr class="memdesc:gaac74937868fb6ebbdce2c9bc9d2ae541"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the buffered compare 0 value.  <a href="#gaac74937868fb6ebbdce2c9bc9d2ae541">More...</a><br /></td></tr>
<tr class="separator:gaac74937868fb6ebbdce2c9bc9d2ae541"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga575b4f5ee5287ba5f9bd10b77a4b6c77"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#ga575b4f5ee5287ba5f9bd10b77a4b6c77">Cy_TCPWM_Counter_EnableCompare0Swap</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *base, uint32_t cntNum, bool enable)</td></tr>
<tr class="memdesc:ga575b4f5ee5287ba5f9bd10b77a4b6c77"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the comparison swap when the comparison value is true.  <a href="#ga575b4f5ee5287ba5f9bd10b77a4b6c77">More...</a><br /></td></tr>
<tr class="separator:ga575b4f5ee5287ba5f9bd10b77a4b6c77"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab1b0e66e97b06eb7fb2ab14aabab7975"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#gab1b0e66e97b06eb7fb2ab14aabab7975">Cy_TCPWM_Counter_SetCounter</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *base, uint32_t cntNum, uint32_t count)</td></tr>
<tr class="memdesc:gab1b0e66e97b06eb7fb2ab14aabab7975"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the value of the counter.  <a href="#gab1b0e66e97b06eb7fb2ab14aabab7975">More...</a><br /></td></tr>
<tr class="separator:gab1b0e66e97b06eb7fb2ab14aabab7975"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga216478872f4b0b65f89691ea577286bb"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#ga216478872f4b0b65f89691ea577286bb">Cy_TCPWM_Counter_GetCounter</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *base, uint32_t cntNum)</td></tr>
<tr class="memdesc:ga216478872f4b0b65f89691ea577286bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the value in the counter.  <a href="#ga216478872f4b0b65f89691ea577286bb">More...</a><br /></td></tr>
<tr class="separator:ga216478872f4b0b65f89691ea577286bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4371e43d1ef1d8b62bdb020947c1c471"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#ga4371e43d1ef1d8b62bdb020947c1c471">Cy_TCPWM_Counter_SetPeriod</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *base, uint32_t cntNum, uint32_t period)</td></tr>
<tr class="memdesc:ga4371e43d1ef1d8b62bdb020947c1c471"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the value of the period register.  <a href="#ga4371e43d1ef1d8b62bdb020947c1c471">More...</a><br /></td></tr>
<tr class="separator:ga4371e43d1ef1d8b62bdb020947c1c471"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaab52729ef8cf456ab6a235a4fff7a7c4"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#gaab52729ef8cf456ab6a235a4fff7a7c4">Cy_TCPWM_Counter_GetPeriod</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *base, uint32_t cntNum)</td></tr>
<tr class="memdesc:gaab52729ef8cf456ab6a235a4fff7a7c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the value in the period register.  <a href="#gaab52729ef8cf456ab6a235a4fff7a7c4">More...</a><br /></td></tr>
<tr class="separator:gaab52729ef8cf456ab6a235a4fff7a7c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga51fde94e6b5c50e167c183b5bd974cf1"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#ga51fde94e6b5c50e167c183b5bd974cf1">Cy_TCPWM_Counter_GetCapture1Val</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *base, uint32_t cntNum)</td></tr>
<tr class="memdesc:ga51fde94e6b5c50e167c183b5bd974cf1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns capture 1 value when capture mode is enabled.  <a href="#ga51fde94e6b5c50e167c183b5bd974cf1">More...</a><br /></td></tr>
<tr class="separator:ga51fde94e6b5c50e167c183b5bd974cf1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga030a99d8b7ae38717a50a3cf731a8902"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#ga030a99d8b7ae38717a50a3cf731a8902">Cy_TCPWM_Counter_GetCapture1BufVal</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *base, uint32_t cntNum)</td></tr>
<tr class="memdesc:ga030a99d8b7ae38717a50a3cf731a8902"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the buffered capture1 value when capture mode is enabled.  <a href="#ga030a99d8b7ae38717a50a3cf731a8902">More...</a><br /></td></tr>
<tr class="separator:ga030a99d8b7ae38717a50a3cf731a8902"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab75b0a611500713330b7bd215e6e071c"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#gab75b0a611500713330b7bd215e6e071c">Cy_TCPWM_Counter_GetCompare1Val</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *base, uint32_t cntNum)</td></tr>
<tr class="memdesc:gab75b0a611500713330b7bd215e6e071c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns compare 1 value.  <a href="#gab75b0a611500713330b7bd215e6e071c">More...</a><br /></td></tr>
<tr class="separator:gab75b0a611500713330b7bd215e6e071c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9fd998d3efb783d7ab9c11b28d48d1a5"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#ga9fd998d3efb783d7ab9c11b28d48d1a5">Cy_TCPWM_Counter_GetCompare1BufVal</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *base, uint32_t cntNum)</td></tr>
<tr class="memdesc:ga9fd998d3efb783d7ab9c11b28d48d1a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the buffered compare1 value.  <a href="#ga9fd998d3efb783d7ab9c11b28d48d1a5">More...</a><br /></td></tr>
<tr class="separator:ga9fd998d3efb783d7ab9c11b28d48d1a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaee822611af74de157e5e2ec64e9eda8"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#gaaee822611af74de157e5e2ec64e9eda8">Cy_TCPWM_Counter_SetCompare1Val</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *base, uint32_t cntNum, uint32_t compare1)</td></tr>
<tr class="memdesc:gaaee822611af74de157e5e2ec64e9eda8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the compare value for Compare1 when the compare mode enabled.  <a href="#gaaee822611af74de157e5e2ec64e9eda8">More...</a><br /></td></tr>
<tr class="separator:gaaee822611af74de157e5e2ec64e9eda8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga657f6b89036053674b03e52f58ded440"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#ga657f6b89036053674b03e52f58ded440">Cy_TCPWM_Counter_SetCompare1BufVal</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *base, uint32_t cntNum, uint32_t compareBuf1)</td></tr>
<tr class="memdesc:ga657f6b89036053674b03e52f58ded440"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the buffered compare value for Compare1 when the compare mode enabled.  <a href="#ga657f6b89036053674b03e52f58ded440">More...</a><br /></td></tr>
<tr class="separator:ga657f6b89036053674b03e52f58ded440"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae8e864267855dd674d618bba19733ce3"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#gae8e864267855dd674d618bba19733ce3">Cy_TCPWM_Counter_EnableCompare1Swap</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *base, uint32_t cntNum, bool enable)</td></tr>
<tr class="memdesc:gae8e864267855dd674d618bba19733ce3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the comparison swap of compare1 and compareBuf1 when the comparison value is true.  <a href="#gae8e864267855dd674d618bba19733ce3">More...</a><br /></td></tr>
<tr class="separator:gae8e864267855dd674d618bba19733ce3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2abece06e0b8d5fe890886ad883e7a41"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#ga2abece06e0b8d5fe890886ad883e7a41">Cy_TCPWM_Counter_EnableSwap</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *base, uint32_t cntNum, bool enable)</td></tr>
<tr class="memdesc:ga2abece06e0b8d5fe890886ad883e7a41"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables/disables swapping mechanism between CC0 and buffered CC0, CC1 and buffered CC1, PERIOD and buffered PERIOD, DT and buffered DT.  <a href="#ga2abece06e0b8d5fe890886ad883e7a41">More...</a><br /></td></tr>
<tr class="separator:ga2abece06e0b8d5fe890886ad883e7a41"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaee3f140d6da2342b0bfb26f629a98ddf"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__tcpwm__functions__counter.html#gaee3f140d6da2342b0bfb26f629a98ddf">Cy_TCPWM_Counter_SetDirection_Change_Mode</a> (<a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *base, uint32_t cntNum, <a class="el" href="group__group__tcpwm__data__structures__counter.html#ga911ca130e2c8ca40b252bd1f7b78c3e5">cy_en_counter_direction_t</a> direction_mode)</td></tr>
<tr class="memdesc:gaee3f140d6da2342b0bfb26f629a98ddf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Direction change mode Based on falling/rising edge of capture0 input.  <a href="#gaee3f140d6da2342b0bfb26f629a98ddf">More...</a><br /></td></tr>
<tr class="separator:gaee3f140d6da2342b0bfb26f629a98ddf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga6068a06ddc8a07c67bb6df86e920944c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6068a06ddc8a07c67bb6df86e920944c">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__tcpwm__enums.html#ga236beaba02c8a2a1c4eec981501e7270">cy_en_tcpwm_status_t</a> Cy_TCPWM_Counter_Init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__tcpwm__counter__config__t.html">cy_stc_tcpwm_counter_config_t</a> const *&#160;</td>
          <td class="paramname"><em>config</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initializes the counter in the TCPWM block for the Counter operation. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
    <tr><td class="paramname">config</td><td>The pointer to configuration structure. See <a class="el" href="structcy__stc__tcpwm__counter__config__t.html">cy_stc_tcpwm_counter_config_t</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>error / status code. See <a class="el" href="group__group__tcpwm__enums.html#ga236beaba02c8a2a1c4eec981501e7270">cy_en_tcpwm_status_t</a>.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is need to initialize</span></div><div class="line"><span class="comment">     * the first (index = 0) counter of the TCPWM0 block</span></div><div class="line"><span class="comment">     * with the below configuration settings</span></div><div class="line"><span class="comment">     */</span></div><div class="line">    <a class="code" href="structcy__stc__tcpwm__counter__config__t.html">cy_stc_tcpwm_counter_config_t</a> tcpwm_v1_counter_config =</div><div class="line">    {</div><div class="line">        <span class="comment">/* .period            = */</span> 99UL, <span class="comment">/* Period of 100 (0-99). Terminal count event when rolls over back to 0. */</span></div><div class="line">        <span class="comment">/* .clockPrescaler    = */</span> <a class="code" href="group__group__tcpwm__counter__clk__prescalers.html#gaefb266045aef34c35384ee6bfe2d5086">CY_TCPWM_COUNTER_PRESCALER_DIVBY_4</a>, <span class="comment">/* Clk_counter = Clk_input / 4 */</span></div><div class="line">        <span class="comment">/* .runMode           = */</span> <a class="code" href="group__group__tcpwm__counter__run__modes.html#ga020c9a67afbd59f6cda9c1469d5270ac">CY_TCPWM_COUNTER_CONTINUOUS</a>, <span class="comment">/* Wrap around at terminal count. */</span></div><div class="line">        <span class="comment">/* .countDirection    = */</span> <a class="code" href="group__group__tcpwm__counter__direction.html#gaad2097cab499746412a80da26d978d3f">CY_TCPWM_COUNTER_COUNT_UP</a>, <span class="comment">/* Up counter, counting from 0 to period value. */</span></div><div class="line">        <span class="comment">/* .compareOrCapture  = */</span> <a class="code" href="group__group__tcpwm__counter__compare__capture.html#gacd6cf6c894bf1bc1550270916166d21c">CY_TCPWM_COUNTER_MODE_COMPARE</a>, <span class="comment">/* Trigger interrupt/event signal when Counter value is equal to Compare 0 */</span></div><div class="line">        <span class="comment">/* .compare0          = */</span> 33UL,</div><div class="line">        <span class="comment">/* .compare1          = */</span> 66UL,</div><div class="line">        <span class="comment">/* .enableCompareSwap = */</span> <span class="keyword">true</span>, <span class="comment">/* Upon a compare event, swap the Compare 0 and Compare 1 values. */</span></div><div class="line">        <span class="comment">/* .interruptSources  = */</span> <a class="code" href="group__group__tcpwm__interrupt__sources.html#gaa7435839c36b6a530452725e9ee2226f">CY_TCPWM_INT_NONE</a>,</div><div class="line">        <span class="comment">/* .captureInputMode  = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga0e441e0d42e07a5bffa0e0d4e9058a26">CY_TCPWM_INPUT_RISINGEDGE</a>, <span class="comment">/* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_RISINGEDGE = 0UL) */</span></div><div class="line">        <span class="comment">/* .captureInput      = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga86b8267d250e656f6e79fbd703bce944">CY_TCPWM_INPUT_0</a>,</div><div class="line">        <span class="comment">/* .reloadInputMode   = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga0e441e0d42e07a5bffa0e0d4e9058a26">CY_TCPWM_INPUT_RISINGEDGE</a>, <span class="comment">/* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_RISINGEDGE = 0UL) */</span></div><div class="line">        <span class="comment">/* .reloadInput       = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga86b8267d250e656f6e79fbd703bce944">CY_TCPWM_INPUT_0</a>,</div><div class="line">        <span class="comment">/* .startInputMode    = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga0e441e0d42e07a5bffa0e0d4e9058a26">CY_TCPWM_INPUT_RISINGEDGE</a>, <span class="comment">/* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_RISINGEDGE = 0UL) */</span></div><div class="line">        <span class="comment">/* .startInput        = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga86b8267d250e656f6e79fbd703bce944">CY_TCPWM_INPUT_0</a>,</div><div class="line">        <span class="comment">/* .stopInputMode     = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga0e441e0d42e07a5bffa0e0d4e9058a26">CY_TCPWM_INPUT_RISINGEDGE</a>, <span class="comment">/* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_RISINGEDGE = 0UL) */</span></div><div class="line">        <span class="comment">/* .stopInput         = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga86b8267d250e656f6e79fbd703bce944">CY_TCPWM_INPUT_0</a>,</div><div class="line">        <span class="comment">/* .countInputMode    = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga6f8ffc8c36941d7d44290147032fd33b">CY_TCPWM_INPUT_LEVEL</a>, <span class="comment">/* Set this input to LEVEL and 1 (high logic level) */</span></div><div class="line">        <span class="comment">/* .countInput        = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga7369f85b221bf7c70e1a580daa6a6bef">CY_TCPWM_INPUT_1</a>, <span class="comment">/* So the counter will count input clock periods (Clk_counter, taking into account the clock prescaler) */</span></div><div class="line">    };</div><div class="line"></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_NUM   (0UL)</span></div><div class="line"></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__tcpwm__enums.html#gga236beaba02c8a2a1c4eec981501e7270af9807d578257fa9f0d29cd86ef2c71ea">CY_TCPWM_SUCCESS</a> != <a class="code" href="group__group__tcpwm__functions__counter.html#ga6068a06ddc8a07c67bb6df86e920944c">Cy_TCPWM_Counter_Init</a>(TCPWM0, MY_TCPWM_CNT_NUM, &amp;tcpwm_v1_counter_config))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Handle possible errors */</span></div><div class="line">    }</div><div class="line">    <span class="comment">/* Enable the initialized counter */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#ga1707e2cc291fe486fbea346157c65bff">Cy_TCPWM_Counter_Enable</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line"></div><div class="line">    <span class="comment">/* Then start the counter */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__common.html#gaafe86ec440bec9a2c23392f289cc3a8b">Cy_TCPWM_TriggerStart_Single</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div></div><!-- fragment --><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is need to initialize</span></div><div class="line"><span class="comment">     * the first (index = 0) counter of the TCPWM0 block</span></div><div class="line"><span class="comment">     * with the below configuration settings</span></div><div class="line"><span class="comment">     */</span></div><div class="line">    <a class="code" href="structcy__stc__tcpwm__counter__config__t.html">cy_stc_tcpwm_counter_config_t</a> tcpwm_v2_counter_config =</div><div class="line">    {</div><div class="line">        <span class="comment">/* .period            = */</span> 99UL, <span class="comment">/* Period of 100 (0-99). Terminal count event when rolls over back to 0. */</span></div><div class="line">        <span class="comment">/* .clockPrescaler    = */</span> <a class="code" href="group__group__tcpwm__counter__clk__prescalers.html#gaefb266045aef34c35384ee6bfe2d5086">CY_TCPWM_COUNTER_PRESCALER_DIVBY_4</a>, <span class="comment">/* Clk_counter = Clk_input / 4 */</span></div><div class="line">        <span class="comment">/* .runMode           = */</span> <a class="code" href="group__group__tcpwm__counter__run__modes.html#ga020c9a67afbd59f6cda9c1469d5270ac">CY_TCPWM_COUNTER_CONTINUOUS</a>, <span class="comment">/* Wrap around at terminal count. */</span></div><div class="line">        <span class="comment">/* .countDirection    = */</span> <a class="code" href="group__group__tcpwm__counter__direction.html#gaad2097cab499746412a80da26d978d3f">CY_TCPWM_COUNTER_COUNT_UP</a>, <span class="comment">/* Up counter, counting from 0 to period value. */</span></div><div class="line">        <span class="comment">/* .compareOrCapture  = */</span> <a class="code" href="group__group__tcpwm__counter__compare__capture.html#gacd6cf6c894bf1bc1550270916166d21c">CY_TCPWM_COUNTER_MODE_COMPARE</a>, <span class="comment">/* Trigger interrupt/event signal when Counter value is equal to Compare 0 */</span></div><div class="line">        <span class="comment">/* .compare0          = */</span> 33UL,</div><div class="line">        <span class="comment">/* .compare1          = */</span> 66UL,</div><div class="line">        <span class="comment">/* .enableCompareSwap = */</span> <span class="keyword">true</span>, <span class="comment">/* Upon a compare event, swap the Compare 0 and Compare 1 values. */</span></div><div class="line">        <span class="comment">/* .interruptSources  = */</span> <a class="code" href="group__group__tcpwm__interrupt__sources.html#gaa7435839c36b6a530452725e9ee2226f">CY_TCPWM_INT_NONE</a>,</div><div class="line">        <span class="comment">/* .captureInputMode  = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga0e441e0d42e07a5bffa0e0d4e9058a26">CY_TCPWM_INPUT_RISINGEDGE</a>, <span class="comment">/* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_RISINGEDGE = 0UL) */</span></div><div class="line">        <span class="comment">/* .captureInput      = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga86b8267d250e656f6e79fbd703bce944">CY_TCPWM_INPUT_0</a>,</div><div class="line">        <span class="comment">/* .reloadInputMode   = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga0e441e0d42e07a5bffa0e0d4e9058a26">CY_TCPWM_INPUT_RISINGEDGE</a>, <span class="comment">/* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_RISINGEDGE = 0UL) */</span></div><div class="line">        <span class="comment">/* .reloadInput       = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga86b8267d250e656f6e79fbd703bce944">CY_TCPWM_INPUT_0</a>,</div><div class="line">        <span class="comment">/* .startInputMode    = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga0e441e0d42e07a5bffa0e0d4e9058a26">CY_TCPWM_INPUT_RISINGEDGE</a>, <span class="comment">/* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_RISINGEDGE = 0UL) */</span></div><div class="line">        <span class="comment">/* .startInput        = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga86b8267d250e656f6e79fbd703bce944">CY_TCPWM_INPUT_0</a>,</div><div class="line">        <span class="comment">/* .stopInputMode     = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga0e441e0d42e07a5bffa0e0d4e9058a26">CY_TCPWM_INPUT_RISINGEDGE</a>, <span class="comment">/* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_RISINGEDGE = 0UL) */</span></div><div class="line">        <span class="comment">/* .stopInput         = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga86b8267d250e656f6e79fbd703bce944">CY_TCPWM_INPUT_0</a>,</div><div class="line">        <span class="comment">/* .countInputMode    = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga6f8ffc8c36941d7d44290147032fd33b">CY_TCPWM_INPUT_LEVEL</a>, <span class="comment">/* Set this input to LEVEL and 1 (high logic level) */</span></div><div class="line">        <span class="comment">/* .countInput        = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga7369f85b221bf7c70e1a580daa6a6bef">CY_TCPWM_INPUT_1</a>, <span class="comment">/* So the counter will count input clock periods (Clk_counter, taking into account the clock prescaler) */</span></div><div class="line">        <span class="comment">/* .capture1InputMode = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga0e441e0d42e07a5bffa0e0d4e9058a26">CY_TCPWM_INPUT_RISINGEDGE</a>, <span class="comment">/* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_RISINGEDGE = 0UL) */</span></div><div class="line">        <span class="comment">/* .capture1Input     = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga86b8267d250e656f6e79fbd703bce944">CY_TCPWM_INPUT_0</a>,</div><div class="line">        <span class="comment">/* .enableCompare1Swap= */</span> <span class="keyword">false</span>, <span class="comment">/* Disable CC1 */</span></div><div class="line">        <span class="comment">/* .compare2          = */</span> 0,</div><div class="line">        <span class="comment">/* .compare3          = */</span> 0,</div><div class="line">        <span class="comment">/* .trigger0Event     = */</span> <a class="code" href="group__group__tcpwm__output__trigger__modes.html#ga80297cac01044cbf8ea2af92c902da7e">CY_TCPWM_CNT_TRIGGER_ON_DISABLED</a>, <span class="comment">/* Disable output trigger0 event generation*/</span></div><div class="line">        <span class="comment">/* .trigger1Event     = */</span> <a class="code" href="group__group__tcpwm__output__trigger__modes.html#ga80297cac01044cbf8ea2af92c902da7e">CY_TCPWM_CNT_TRIGGER_ON_DISABLED</a>, <span class="comment">/* Disable output trigger1 event generation*/</span></div><div class="line">    };</div><div class="line"></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_NUM   (0UL)</span></div><div class="line"></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__tcpwm__enums.html#gga236beaba02c8a2a1c4eec981501e7270af9807d578257fa9f0d29cd86ef2c71ea">CY_TCPWM_SUCCESS</a> != <a class="code" href="group__group__tcpwm__functions__counter.html#ga6068a06ddc8a07c67bb6df86e920944c">Cy_TCPWM_Counter_Init</a>(TCPWM0, MY_TCPWM_CNT_NUM, &amp;tcpwm_v2_counter_config))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Handle possible errors */</span></div><div class="line">    }</div><div class="line">    <span class="comment">/* Enable the initialized counter */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#ga1707e2cc291fe486fbea346157c65bff">Cy_TCPWM_Counter_Enable</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line"></div><div class="line">    <span class="comment">/* Then start the counter */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__common.html#gaafe86ec440bec9a2c23392f289cc3a8b">Cy_TCPWM_TriggerStart_Single</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga162b6671930fb1951d6678cc5805dfbb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga162b6671930fb1951d6678cc5805dfbb">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_DeInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_TCPWM_Counter_DeInit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__tcpwm__counter__config__t.html">cy_stc_tcpwm_counter_config_t</a> const *&#160;</td>
          <td class="paramname"><em>config</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>De-initializes the counter in the TCPWM block, returns register values to default. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
    <tr><td class="paramname">config</td><td>The pointer to configuration structure. See <a class="el" href="structcy__stc__tcpwm__counter__config__t.html">cy_stc_tcpwm_counter_config_t</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is need to deinitialize the previously initialized counter */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_NUM   (0UL)</span></div><div class="line"></div><div class="line">    <span class="comment">/* Disable the counter prior to deinitializing */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#ga6edbf345956ab2fce23b5e98c0207ae6">Cy_TCPWM_Counter_Disable</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#ga162b6671930fb1951d6678cc5805dfbb">Cy_TCPWM_Counter_DeInit</a>(TCPWM0, MY_TCPWM_CNT_NUM, &amp;config);</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga1707e2cc291fe486fbea346157c65bff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1707e2cc291fe486fbea346157c65bff">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_Enable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_TCPWM_Counter_Enable </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enables the counter in the TCPWM block for the Counter operation. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is need to initialize</span></div><div class="line"><span class="comment">     * the first (index = 0) counter of the TCPWM0 block</span></div><div class="line"><span class="comment">     * with the below configuration settings</span></div><div class="line"><span class="comment">     */</span></div><div class="line">    <a class="code" href="structcy__stc__tcpwm__counter__config__t.html">cy_stc_tcpwm_counter_config_t</a> tcpwm_v1_counter_config =</div><div class="line">    {</div><div class="line">        <span class="comment">/* .period            = */</span> 99UL, <span class="comment">/* Period of 100 (0-99). Terminal count event when rolls over back to 0. */</span></div><div class="line">        <span class="comment">/* .clockPrescaler    = */</span> <a class="code" href="group__group__tcpwm__counter__clk__prescalers.html#gaefb266045aef34c35384ee6bfe2d5086">CY_TCPWM_COUNTER_PRESCALER_DIVBY_4</a>, <span class="comment">/* Clk_counter = Clk_input / 4 */</span></div><div class="line">        <span class="comment">/* .runMode           = */</span> <a class="code" href="group__group__tcpwm__counter__run__modes.html#ga020c9a67afbd59f6cda9c1469d5270ac">CY_TCPWM_COUNTER_CONTINUOUS</a>, <span class="comment">/* Wrap around at terminal count. */</span></div><div class="line">        <span class="comment">/* .countDirection    = */</span> <a class="code" href="group__group__tcpwm__counter__direction.html#gaad2097cab499746412a80da26d978d3f">CY_TCPWM_COUNTER_COUNT_UP</a>, <span class="comment">/* Up counter, counting from 0 to period value. */</span></div><div class="line">        <span class="comment">/* .compareOrCapture  = */</span> <a class="code" href="group__group__tcpwm__counter__compare__capture.html#gacd6cf6c894bf1bc1550270916166d21c">CY_TCPWM_COUNTER_MODE_COMPARE</a>, <span class="comment">/* Trigger interrupt/event signal when Counter value is equal to Compare 0 */</span></div><div class="line">        <span class="comment">/* .compare0          = */</span> 33UL,</div><div class="line">        <span class="comment">/* .compare1          = */</span> 66UL,</div><div class="line">        <span class="comment">/* .enableCompareSwap = */</span> <span class="keyword">true</span>, <span class="comment">/* Upon a compare event, swap the Compare 0 and Compare 1 values. */</span></div><div class="line">        <span class="comment">/* .interruptSources  = */</span> <a class="code" href="group__group__tcpwm__interrupt__sources.html#gaa7435839c36b6a530452725e9ee2226f">CY_TCPWM_INT_NONE</a>,</div><div class="line">        <span class="comment">/* .captureInputMode  = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga0e441e0d42e07a5bffa0e0d4e9058a26">CY_TCPWM_INPUT_RISINGEDGE</a>, <span class="comment">/* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_RISINGEDGE = 0UL) */</span></div><div class="line">        <span class="comment">/* .captureInput      = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga86b8267d250e656f6e79fbd703bce944">CY_TCPWM_INPUT_0</a>,</div><div class="line">        <span class="comment">/* .reloadInputMode   = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga0e441e0d42e07a5bffa0e0d4e9058a26">CY_TCPWM_INPUT_RISINGEDGE</a>, <span class="comment">/* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_RISINGEDGE = 0UL) */</span></div><div class="line">        <span class="comment">/* .reloadInput       = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga86b8267d250e656f6e79fbd703bce944">CY_TCPWM_INPUT_0</a>,</div><div class="line">        <span class="comment">/* .startInputMode    = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga0e441e0d42e07a5bffa0e0d4e9058a26">CY_TCPWM_INPUT_RISINGEDGE</a>, <span class="comment">/* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_RISINGEDGE = 0UL) */</span></div><div class="line">        <span class="comment">/* .startInput        = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga86b8267d250e656f6e79fbd703bce944">CY_TCPWM_INPUT_0</a>,</div><div class="line">        <span class="comment">/* .stopInputMode     = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga0e441e0d42e07a5bffa0e0d4e9058a26">CY_TCPWM_INPUT_RISINGEDGE</a>, <span class="comment">/* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_RISINGEDGE = 0UL) */</span></div><div class="line">        <span class="comment">/* .stopInput         = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga86b8267d250e656f6e79fbd703bce944">CY_TCPWM_INPUT_0</a>,</div><div class="line">        <span class="comment">/* .countInputMode    = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga6f8ffc8c36941d7d44290147032fd33b">CY_TCPWM_INPUT_LEVEL</a>, <span class="comment">/* Set this input to LEVEL and 1 (high logic level) */</span></div><div class="line">        <span class="comment">/* .countInput        = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga7369f85b221bf7c70e1a580daa6a6bef">CY_TCPWM_INPUT_1</a>, <span class="comment">/* So the counter will count input clock periods (Clk_counter, taking into account the clock prescaler) */</span></div><div class="line">    };</div><div class="line"></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_NUM   (0UL)</span></div><div class="line"></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__tcpwm__enums.html#gga236beaba02c8a2a1c4eec981501e7270af9807d578257fa9f0d29cd86ef2c71ea">CY_TCPWM_SUCCESS</a> != <a class="code" href="group__group__tcpwm__functions__counter.html#ga6068a06ddc8a07c67bb6df86e920944c">Cy_TCPWM_Counter_Init</a>(TCPWM0, MY_TCPWM_CNT_NUM, &amp;tcpwm_v1_counter_config))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Handle possible errors */</span></div><div class="line">    }</div><div class="line">    <span class="comment">/* Enable the initialized counter */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#ga1707e2cc291fe486fbea346157c65bff">Cy_TCPWM_Counter_Enable</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line"></div><div class="line">    <span class="comment">/* Then start the counter */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__common.html#gaafe86ec440bec9a2c23392f289cc3a8b">Cy_TCPWM_TriggerStart_Single</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div></div><!-- fragment --><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is need to initialize</span></div><div class="line"><span class="comment">     * the first (index = 0) counter of the TCPWM0 block</span></div><div class="line"><span class="comment">     * with the below configuration settings</span></div><div class="line"><span class="comment">     */</span></div><div class="line">    <a class="code" href="structcy__stc__tcpwm__counter__config__t.html">cy_stc_tcpwm_counter_config_t</a> tcpwm_v2_counter_config =</div><div class="line">    {</div><div class="line">        <span class="comment">/* .period            = */</span> 99UL, <span class="comment">/* Period of 100 (0-99). Terminal count event when rolls over back to 0. */</span></div><div class="line">        <span class="comment">/* .clockPrescaler    = */</span> <a class="code" href="group__group__tcpwm__counter__clk__prescalers.html#gaefb266045aef34c35384ee6bfe2d5086">CY_TCPWM_COUNTER_PRESCALER_DIVBY_4</a>, <span class="comment">/* Clk_counter = Clk_input / 4 */</span></div><div class="line">        <span class="comment">/* .runMode           = */</span> <a class="code" href="group__group__tcpwm__counter__run__modes.html#ga020c9a67afbd59f6cda9c1469d5270ac">CY_TCPWM_COUNTER_CONTINUOUS</a>, <span class="comment">/* Wrap around at terminal count. */</span></div><div class="line">        <span class="comment">/* .countDirection    = */</span> <a class="code" href="group__group__tcpwm__counter__direction.html#gaad2097cab499746412a80da26d978d3f">CY_TCPWM_COUNTER_COUNT_UP</a>, <span class="comment">/* Up counter, counting from 0 to period value. */</span></div><div class="line">        <span class="comment">/* .compareOrCapture  = */</span> <a class="code" href="group__group__tcpwm__counter__compare__capture.html#gacd6cf6c894bf1bc1550270916166d21c">CY_TCPWM_COUNTER_MODE_COMPARE</a>, <span class="comment">/* Trigger interrupt/event signal when Counter value is equal to Compare 0 */</span></div><div class="line">        <span class="comment">/* .compare0          = */</span> 33UL,</div><div class="line">        <span class="comment">/* .compare1          = */</span> 66UL,</div><div class="line">        <span class="comment">/* .enableCompareSwap = */</span> <span class="keyword">true</span>, <span class="comment">/* Upon a compare event, swap the Compare 0 and Compare 1 values. */</span></div><div class="line">        <span class="comment">/* .interruptSources  = */</span> <a class="code" href="group__group__tcpwm__interrupt__sources.html#gaa7435839c36b6a530452725e9ee2226f">CY_TCPWM_INT_NONE</a>,</div><div class="line">        <span class="comment">/* .captureInputMode  = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga0e441e0d42e07a5bffa0e0d4e9058a26">CY_TCPWM_INPUT_RISINGEDGE</a>, <span class="comment">/* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_RISINGEDGE = 0UL) */</span></div><div class="line">        <span class="comment">/* .captureInput      = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga86b8267d250e656f6e79fbd703bce944">CY_TCPWM_INPUT_0</a>,</div><div class="line">        <span class="comment">/* .reloadInputMode   = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga0e441e0d42e07a5bffa0e0d4e9058a26">CY_TCPWM_INPUT_RISINGEDGE</a>, <span class="comment">/* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_RISINGEDGE = 0UL) */</span></div><div class="line">        <span class="comment">/* .reloadInput       = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga86b8267d250e656f6e79fbd703bce944">CY_TCPWM_INPUT_0</a>,</div><div class="line">        <span class="comment">/* .startInputMode    = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga0e441e0d42e07a5bffa0e0d4e9058a26">CY_TCPWM_INPUT_RISINGEDGE</a>, <span class="comment">/* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_RISINGEDGE = 0UL) */</span></div><div class="line">        <span class="comment">/* .startInput        = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga86b8267d250e656f6e79fbd703bce944">CY_TCPWM_INPUT_0</a>,</div><div class="line">        <span class="comment">/* .stopInputMode     = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga0e441e0d42e07a5bffa0e0d4e9058a26">CY_TCPWM_INPUT_RISINGEDGE</a>, <span class="comment">/* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_RISINGEDGE = 0UL) */</span></div><div class="line">        <span class="comment">/* .stopInput         = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga86b8267d250e656f6e79fbd703bce944">CY_TCPWM_INPUT_0</a>,</div><div class="line">        <span class="comment">/* .countInputMode    = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga6f8ffc8c36941d7d44290147032fd33b">CY_TCPWM_INPUT_LEVEL</a>, <span class="comment">/* Set this input to LEVEL and 1 (high logic level) */</span></div><div class="line">        <span class="comment">/* .countInput        = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga7369f85b221bf7c70e1a580daa6a6bef">CY_TCPWM_INPUT_1</a>, <span class="comment">/* So the counter will count input clock periods (Clk_counter, taking into account the clock prescaler) */</span></div><div class="line">        <span class="comment">/* .capture1InputMode = */</span> <a class="code" href="group__group__tcpwm__input__modes.html#ga0e441e0d42e07a5bffa0e0d4e9058a26">CY_TCPWM_INPUT_RISINGEDGE</a>, <span class="comment">/* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_RISINGEDGE = 0UL) */</span></div><div class="line">        <span class="comment">/* .capture1Input     = */</span> <a class="code" href="group__group__tcpwm__input__selection.html#ga86b8267d250e656f6e79fbd703bce944">CY_TCPWM_INPUT_0</a>,</div><div class="line">        <span class="comment">/* .enableCompare1Swap= */</span> <span class="keyword">false</span>, <span class="comment">/* Disable CC1 */</span></div><div class="line">        <span class="comment">/* .compare2          = */</span> 0,</div><div class="line">        <span class="comment">/* .compare3          = */</span> 0,</div><div class="line">        <span class="comment">/* .trigger0Event     = */</span> <a class="code" href="group__group__tcpwm__output__trigger__modes.html#ga80297cac01044cbf8ea2af92c902da7e">CY_TCPWM_CNT_TRIGGER_ON_DISABLED</a>, <span class="comment">/* Disable output trigger0 event generation*/</span></div><div class="line">        <span class="comment">/* .trigger1Event     = */</span> <a class="code" href="group__group__tcpwm__output__trigger__modes.html#ga80297cac01044cbf8ea2af92c902da7e">CY_TCPWM_CNT_TRIGGER_ON_DISABLED</a>, <span class="comment">/* Disable output trigger1 event generation*/</span></div><div class="line">    };</div><div class="line"></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_NUM   (0UL)</span></div><div class="line"></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__tcpwm__enums.html#gga236beaba02c8a2a1c4eec981501e7270af9807d578257fa9f0d29cd86ef2c71ea">CY_TCPWM_SUCCESS</a> != <a class="code" href="group__group__tcpwm__functions__counter.html#ga6068a06ddc8a07c67bb6df86e920944c">Cy_TCPWM_Counter_Init</a>(TCPWM0, MY_TCPWM_CNT_NUM, &amp;tcpwm_v2_counter_config))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Handle possible errors */</span></div><div class="line">    }</div><div class="line">    <span class="comment">/* Enable the initialized counter */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#ga1707e2cc291fe486fbea346157c65bff">Cy_TCPWM_Counter_Enable</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line"></div><div class="line">    <span class="comment">/* Then start the counter */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__common.html#gaafe86ec440bec9a2c23392f289cc3a8b">Cy_TCPWM_TriggerStart_Single</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga6edbf345956ab2fce23b5e98c0207ae6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6edbf345956ab2fce23b5e98c0207ae6">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_Disable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_TCPWM_Counter_Disable </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disables the counter in the TCPWM block. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is need to deinitialize the previously initialized counter */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_NUM   (0UL)</span></div><div class="line"></div><div class="line">    <span class="comment">/* Disable the counter prior to deinitializing */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#ga6edbf345956ab2fce23b5e98c0207ae6">Cy_TCPWM_Counter_Disable</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#ga162b6671930fb1951d6678cc5805dfbb">Cy_TCPWM_Counter_DeInit</a>(TCPWM0, MY_TCPWM_CNT_NUM, &amp;config);</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gae39af6cd9306eaca090fa62999fd81af"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae39af6cd9306eaca090fa62999fd81af">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_GetStatus()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_TCPWM_Counter_GetStatus </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the status of the Counter Timer whether it is running or not. </p>
<p>In case the Counter is running, status will also provide information on counting up/down. This is useful when the counter mode is set to UP_DOWN_1 or UP_DOWN_2.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status. See <a class="el" href="group__group__tcpwm__counter__status.html">Counter Status</a></dd></dl>
<dl class="section note"><dt>Note</dt><dd>The status value is not the same as in TCPWM status register.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is a need to check if</span></div><div class="line"><span class="comment">     * the first (index = 0) counter of the TCPWM0 block is running or not.</span></div><div class="line"><span class="comment">     */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_NUM   (0UL)</span></div><div class="line"></div><div class="line">    uint32_t status = <a class="code" href="group__group__tcpwm__functions__counter.html#gae39af6cd9306eaca090fa62999fd81af">Cy_TCPWM_Counter_GetStatus</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line"></div><div class="line">    <span class="keywordflow">if</span> ((<a class="code" href="group__group__tcpwm__counter__status.html#gaed832defdd98a1329e6d6d4a367ebe8c">CY_TCPWM_COUNTER_STATUS_COUNTER_RUNNING</a> &amp; status) &amp;&amp; (<a class="code" href="group__group__tcpwm__counter__status.html#ga396c16ed6268de8dacdd23a55a41cd82">CY_TCPWM_COUNTER_STATUS_UP_COUNTING</a> &amp; status))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Up Counting */</span></div><div class="line">    }</div><div class="line">    <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((<a class="code" href="group__group__tcpwm__counter__status.html#gaed832defdd98a1329e6d6d4a367ebe8c">CY_TCPWM_COUNTER_STATUS_COUNTER_RUNNING</a> &amp; status) &amp;&amp; (<a class="code" href="group__group__tcpwm__counter__status.html#ga606650b6b79795aec7de42ea5b871f73">CY_TCPWM_COUNTER_STATUS_DOWN_COUNTING</a> &amp; status))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Down Counting */</span></div><div class="line">    }</div><div class="line">    <span class="keywordflow">else</span></div><div class="line">    {</div><div class="line">        <span class="comment">/* Counter is not running */</span></div><div class="line">    }</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga53321a824ba298d75d8bed089bfb4595"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga53321a824ba298d75d8bed089bfb4595">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_GetCapture0Val()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_TCPWM_Counter_GetCapture0Val </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the capture 0 value when the capture mode is enabled. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The capture 0 value.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is a need to trigger software capture events for</span></div><div class="line"><span class="comment">     * the first (index = 0) counter of the TCPWM0 block.</span></div><div class="line"><span class="comment">     * Note: the counter should run in the Capture Mode.</span></div><div class="line"><span class="comment">     */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_NUM   (0UL)</span></div><div class="line"></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__common.html#gadba9d406c3bd2b008aa7bbadcd5f32c2">Cy_TCPWM_TriggerCaptureOrSwap_Single</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line">    <span class="comment">/* after some time */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__common.html#gadba9d406c3bd2b008aa7bbadcd5f32c2">Cy_TCPWM_TriggerCaptureOrSwap_Single</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line"></div><div class="line">    <span class="comment">/* Now we can get the latest captured value</span></div><div class="line"><span class="comment">     * (captured during the second call of Cy_TCPWM_TriggerCaptureOrSwap_Single)</span></div><div class="line"><span class="comment">     */</span></div><div class="line">    uint32_t capture = <a class="code" href="group__group__tcpwm__functions__counter.html#ga53321a824ba298d75d8bed089bfb4595">Cy_TCPWM_Counter_GetCapture0Val</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line">    <span class="comment">/* Also the previous captured value</span></div><div class="line"><span class="comment">     * (captured during the first call of Cy_TCPWM_TriggerCaptureOrSwap_Single)</span></div><div class="line"><span class="comment">     * is available by the next way</span></div><div class="line"><span class="comment">     */</span></div><div class="line">    uint32_t captureBuf = <a class="code" href="group__group__tcpwm__functions__counter.html#gabc22432c63203412232182d676caa149">Cy_TCPWM_Counter_GetCapture0BufVal</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gabc22432c63203412232182d676caa149"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabc22432c63203412232182d676caa149">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_GetCapture0BufVal()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_TCPWM_Counter_GetCapture0BufVal </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the buffered capture 0 value when the capture mode is enabled. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The buffered capture 0 value.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is a need to trigger software capture events for</span></div><div class="line"><span class="comment">     * the first (index = 0) counter of the TCPWM0 block.</span></div><div class="line"><span class="comment">     * Note: the counter should run in the Capture Mode.</span></div><div class="line"><span class="comment">     */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_NUM   (0UL)</span></div><div class="line"></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__common.html#gadba9d406c3bd2b008aa7bbadcd5f32c2">Cy_TCPWM_TriggerCaptureOrSwap_Single</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line">    <span class="comment">/* after some time */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__common.html#gadba9d406c3bd2b008aa7bbadcd5f32c2">Cy_TCPWM_TriggerCaptureOrSwap_Single</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line"></div><div class="line">    <span class="comment">/* Now we can get the latest captured value</span></div><div class="line"><span class="comment">     * (captured during the second call of Cy_TCPWM_TriggerCaptureOrSwap_Single)</span></div><div class="line"><span class="comment">     */</span></div><div class="line">    uint32_t capture = <a class="code" href="group__group__tcpwm__functions__counter.html#ga53321a824ba298d75d8bed089bfb4595">Cy_TCPWM_Counter_GetCapture0Val</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line">    <span class="comment">/* Also the previous captured value</span></div><div class="line"><span class="comment">     * (captured during the first call of Cy_TCPWM_TriggerCaptureOrSwap_Single)</span></div><div class="line"><span class="comment">     * is available by the next way</span></div><div class="line"><span class="comment">     */</span></div><div class="line">    uint32_t captureBuf = <a class="code" href="group__group__tcpwm__functions__counter.html#gabc22432c63203412232182d676caa149">Cy_TCPWM_Counter_GetCapture0BufVal</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gaddb9ccef6ad2fc1af0a87d5929a72ce7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaddb9ccef6ad2fc1af0a87d5929a72ce7">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_SetCompare0Val()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_TCPWM_Counter_SetCompare0Val </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>compare0</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the compare value for Compare0 when the compare mode is enabled. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
    <tr><td class="paramname">compare0</td><td>The Compare0 value.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is a need to modify the Compare 0 value of</span></div><div class="line"><span class="comment">     * the first (index = 0) counter of the TCPWM0 block.</span></div><div class="line"><span class="comment">     * Note: the counter should run in the Compare Mode.</span></div><div class="line"><span class="comment">     */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_NUM   (0UL)</span></div><div class="line"></div><div class="line">    <span class="comment">/* Stop the counter for clear transition */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__common.html#gad1459b0ddabf388afe151de57f7cf4d4">Cy_TCPWM_TriggerStopOrKill_Single</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line">    <span class="comment">/* Get the currently existing Compare 0 value */</span></div><div class="line">    uint32_t compare = <a class="code" href="group__group__tcpwm__functions__counter.html#ga21df9e952f046d91ed704a9a452ce837">Cy_TCPWM_Counter_GetCompare0Val</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line">    <span class="comment">/* Modify the compare value here */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#gaddb9ccef6ad2fc1af0a87d5929a72ce7">Cy_TCPWM_Counter_SetCompare0Val</a>(TCPWM0, MY_TCPWM_CNT_NUM, compare);</div><div class="line">    <span class="comment">/* Restart the counter with the new Compare 0 value */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__common.html#ga710f6bd4caaeda13df9c2ab91b8d1571">Cy_TCPWM_TriggerReloadOrIndex_Single</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga21df9e952f046d91ed704a9a452ce837"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga21df9e952f046d91ed704a9a452ce837">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_GetCompare0Val()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_TCPWM_Counter_GetCompare0Val </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns compare 0 value. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Compare 0 value.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is a need to modify the Compare 0 value of</span></div><div class="line"><span class="comment">     * the first (index = 0) counter of the TCPWM0 block.</span></div><div class="line"><span class="comment">     * Note: the counter should run in the Compare Mode.</span></div><div class="line"><span class="comment">     */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_NUM   (0UL)</span></div><div class="line"></div><div class="line">    <span class="comment">/* Stop the counter for clear transition */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__common.html#gad1459b0ddabf388afe151de57f7cf4d4">Cy_TCPWM_TriggerStopOrKill_Single</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line">    <span class="comment">/* Get the currently existing Compare 0 value */</span></div><div class="line">    uint32_t compare = <a class="code" href="group__group__tcpwm__functions__counter.html#ga21df9e952f046d91ed704a9a452ce837">Cy_TCPWM_Counter_GetCompare0Val</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line">    <span class="comment">/* Modify the compare value here */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#gaddb9ccef6ad2fc1af0a87d5929a72ce7">Cy_TCPWM_Counter_SetCompare0Val</a>(TCPWM0, MY_TCPWM_CNT_NUM, compare);</div><div class="line">    <span class="comment">/* Restart the counter with the new Compare 0 value */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__common.html#ga710f6bd4caaeda13df9c2ab91b8d1571">Cy_TCPWM_TriggerReloadOrIndex_Single</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gaff1f4c6bdbdbeae956d541909250ad78"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaff1f4c6bdbdbeae956d541909250ad78">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_SetCompare0BufVal()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_TCPWM_Counter_SetCompare0BufVal </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>compare1</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the compare value for Compare1 when the compare mode is enabled. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
    <tr><td class="paramname">compare1</td><td>The Compare1 value.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is a need to modify the alternative compare value</span></div><div class="line"><span class="comment">     * (Compare 1) for the first (index = 0) counter of the TCPWM0 block.</span></div><div class="line"><span class="comment">     * Note: the counter should run in the Compare Mode.</span></div><div class="line"><span class="comment">     * Note: the compare swapping feature should be enabled.</span></div><div class="line"><span class="comment">     */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_NUM   (0UL)</span></div><div class="line"></div><div class="line">    <span class="comment">/* Get the currently existing Compare 1 value */</span></div><div class="line">    uint32_t compare = <a class="code" href="group__group__tcpwm__functions__counter.html#gaac74937868fb6ebbdce2c9bc9d2ae541">Cy_TCPWM_Counter_GetCompare0BufVal</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line">    <span class="comment">/* Modify the compare value here */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#gaff1f4c6bdbdbeae956d541909250ad78">Cy_TCPWM_Counter_SetCompare0BufVal</a>(TCPWM0, MY_TCPWM_CNT_NUM, compare);</div><div class="line">    <span class="comment">/* Now the Compare 0 and Compare 1 values can be swapped using Cy_TCPWM_TriggerCaptureOrSwap_Single */</span></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gaac74937868fb6ebbdce2c9bc9d2ae541"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaac74937868fb6ebbdce2c9bc9d2ae541">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_GetCompare0BufVal()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_TCPWM_Counter_GetCompare0BufVal </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the buffered compare 0 value. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Buffered Compare 0 value.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is a need to modify the alternative compare value</span></div><div class="line"><span class="comment">     * (Compare 1) for the first (index = 0) counter of the TCPWM0 block.</span></div><div class="line"><span class="comment">     * Note: the counter should run in the Compare Mode.</span></div><div class="line"><span class="comment">     * Note: the compare swapping feature should be enabled.</span></div><div class="line"><span class="comment">     */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_NUM   (0UL)</span></div><div class="line"></div><div class="line">    <span class="comment">/* Get the currently existing Compare 1 value */</span></div><div class="line">    uint32_t compare = <a class="code" href="group__group__tcpwm__functions__counter.html#gaac74937868fb6ebbdce2c9bc9d2ae541">Cy_TCPWM_Counter_GetCompare0BufVal</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line">    <span class="comment">/* Modify the compare value here */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#gaff1f4c6bdbdbeae956d541909250ad78">Cy_TCPWM_Counter_SetCompare0BufVal</a>(TCPWM0, MY_TCPWM_CNT_NUM, compare);</div><div class="line">    <span class="comment">/* Now the Compare 0 and Compare 1 values can be swapped using Cy_TCPWM_TriggerCaptureOrSwap_Single */</span></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga575b4f5ee5287ba5f9bd10b77a4b6c77"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga575b4f5ee5287ba5f9bd10b77a4b6c77">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_EnableCompare0Swap()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_TCPWM_Counter_EnableCompare0Swap </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enables the comparison swap when the comparison value is true. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
    <tr><td class="paramname">enable</td><td>true = swap enabled, false = swap disabled</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is a need to enable the compare swapping feature for</span></div><div class="line"><span class="comment">     * the first (index = 0) counter of the TCPWM0 block.</span></div><div class="line"><span class="comment">     */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_NUM   (0UL)</span></div><div class="line"></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#ga575b4f5ee5287ba5f9bd10b77a4b6c77">Cy_TCPWM_Counter_EnableCompare0Swap</a>(TCPWM0, MY_TCPWM_CNT_NUM, <span class="keyword">true</span>);</div><div class="line">    <span class="comment">/* Now the Compare 0 and Compare 1 values can be swapped using Cy_TCPWM_TriggerCaptureOrSwap_Single */</span></div></div><!-- fragment --> </dd></dl>
<dl class="section note"><dt>Note</dt><dd>From Version 3 of TCPWM, this feature is coupled with the swap enable feature (<a class="el" href="group__group__tcpwm__functions__counter.html#ga2abece06e0b8d5fe890886ad883e7a41" title="Enables/disables swapping mechanism between CC0 and buffered CC0, CC1 and buffered CC1...">Cy_TCPWM_Counter_EnableSwap()</a>). when both reload and swap are enabled then CC0 value is swapped with CC0 buff value. When only reload is enabled then CC0 buff value is copied to CC0. There is no action when reload is disabled. </dd></dl>

</div>
</div>
<a id="gab1b0e66e97b06eb7fb2ab14aabab7975"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab1b0e66e97b06eb7fb2ab14aabab7975">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_SetCounter()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_TCPWM_Counter_SetCounter </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the value of the counter. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
    <tr><td class="paramname">count</td><td>The value to write into the counter.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is a need to set the counter value for</span></div><div class="line"><span class="comment">     * the first (index = 0) counter of the TCPWM0 block</span></div><div class="line"><span class="comment">     */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_NUM   (0UL)</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_VAL   (100UL)</span></div><div class="line"></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__common.html#gad1459b0ddabf388afe151de57f7cf4d4">Cy_TCPWM_TriggerStopOrKill_Single</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#gab1b0e66e97b06eb7fb2ab14aabab7975">Cy_TCPWM_Counter_SetCounter</a>(TCPWM0, MY_TCPWM_CNT_NUM, MY_TCPWM_CNT_VAL);</div><div class="line">    <a class="code" href="group__group__tcpwm__functions__common.html#gaafe86ec440bec9a2c23392f289cc3a8b">Cy_TCPWM_TriggerStart_Single</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga216478872f4b0b65f89691ea577286bb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga216478872f4b0b65f89691ea577286bb">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_GetCounter()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_TCPWM_Counter_GetCounter </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the value in the counter. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The current counter value.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is a need to get the current counter value of</span></div><div class="line"><span class="comment">     * the first (index = 0) counter of the TCPWM0 block</span></div><div class="line"><span class="comment">     */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_NUM   (0UL)</span></div><div class="line"></div><div class="line">    uint32_t count = <a class="code" href="group__group__tcpwm__functions__counter.html#ga216478872f4b0b65f89691ea577286bb">Cy_TCPWM_Counter_GetCounter</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga4371e43d1ef1d8b62bdb020947c1c471"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4371e43d1ef1d8b62bdb020947c1c471">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_SetPeriod()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_TCPWM_Counter_SetPeriod </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>period</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the value of the period register. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
    <tr><td class="paramname">period</td><td>The value to write into a period.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is a need to modify the period of</span></div><div class="line"><span class="comment">     * the first (index = 0) counter of the TCPWM0 block.</span></div><div class="line"><span class="comment">     */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_NUM   (0UL)</span></div><div class="line"></div><div class="line">    <span class="comment">/* Get the currently existing period value */</span></div><div class="line">    uint32_t period = <a class="code" href="group__group__tcpwm__functions__counter.html#gaab52729ef8cf456ab6a235a4fff7a7c4">Cy_TCPWM_Counter_GetPeriod</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line">    <span class="comment">/* Modify the period value here */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#ga4371e43d1ef1d8b62bdb020947c1c471">Cy_TCPWM_Counter_SetPeriod</a>(TCPWM0, MY_TCPWM_CNT_NUM, period);</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gaab52729ef8cf456ab6a235a4fff7a7c4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaab52729ef8cf456ab6a235a4fff7a7c4">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_GetPeriod()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_TCPWM_Counter_GetPeriod </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the value in the period register. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The current period value.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is a need to modify the period of</span></div><div class="line"><span class="comment">     * the first (index = 0) counter of the TCPWM0 block.</span></div><div class="line"><span class="comment">     */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_CNT_NUM   (0UL)</span></div><div class="line"></div><div class="line">    <span class="comment">/* Get the currently existing period value */</span></div><div class="line">    uint32_t period = <a class="code" href="group__group__tcpwm__functions__counter.html#gaab52729ef8cf456ab6a235a4fff7a7c4">Cy_TCPWM_Counter_GetPeriod</a>(TCPWM0, MY_TCPWM_CNT_NUM);</div><div class="line">    <span class="comment">/* Modify the period value here */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#ga4371e43d1ef1d8b62bdb020947c1c471">Cy_TCPWM_Counter_SetPeriod</a>(TCPWM0, MY_TCPWM_CNT_NUM, period);</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga51fde94e6b5c50e167c183b5bd974cf1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga51fde94e6b5c50e167c183b5bd974cf1">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_GetCapture1Val()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_TCPWM_Counter_GetCapture1Val </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns capture 1 value when capture mode is enabled. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Capture 1 value. </dd></dl>

</div>
</div>
<a id="ga030a99d8b7ae38717a50a3cf731a8902"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga030a99d8b7ae38717a50a3cf731a8902">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_GetCapture1BufVal()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_TCPWM_Counter_GetCapture1BufVal </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the buffered capture1 value when capture mode is enabled. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Buffered capture1 value. </dd></dl>

</div>
</div>
<a id="gab75b0a611500713330b7bd215e6e071c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab75b0a611500713330b7bd215e6e071c">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_GetCompare1Val()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_TCPWM_Counter_GetCompare1Val </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns compare 1 value. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Compare 1 value.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is a need to modify the alternative compare value</span></div><div class="line"><span class="comment">     * (Compare 1) for the first (index = 256) counter of Group 1 of the TCPWM0 block.</span></div><div class="line"><span class="comment">     * Note: the counter should run in the Compare Mode.</span></div><div class="line"><span class="comment">     * Note: the compare swapping feature should be enabled.</span></div><div class="line"><span class="comment">     */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_GRP1_CNT0_NUM   (256UL)</span></div><div class="line"></div><div class="line">    <span class="comment">/* Get the currently existing Compare 1 value and set a new Compare 1 Val */</span></div><div class="line">    uint32_t compare1 = <a class="code" href="group__group__tcpwm__functions__counter.html#gab75b0a611500713330b7bd215e6e071c">Cy_TCPWM_Counter_GetCompare1Val</a>(TCPWM0, MY_TCPWM_GRP1_CNT0_NUM);</div><div class="line">    <span class="comment">/* Modify the compare value here */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#gaaee822611af74de157e5e2ec64e9eda8">Cy_TCPWM_Counter_SetCompare1Val</a>(TCPWM0, MY_TCPWM_GRP1_CNT0_NUM, compare1);</div><div class="line"></div><div class="line">    <span class="comment">/* Get the currently existing Compare1Buf value and set a new Compare1Buf Val */</span></div><div class="line">    uint32_t compareBuf1 = <a class="code" href="group__group__tcpwm__functions__counter.html#ga9fd998d3efb783d7ab9c11b28d48d1a5">Cy_TCPWM_Counter_GetCompare1BufVal</a>(TCPWM0, MY_TCPWM_GRP1_CNT0_NUM);</div><div class="line">    <span class="comment">/* Modify the compare1Buff value here */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#ga657f6b89036053674b03e52f58ded440">Cy_TCPWM_Counter_SetCompare1BufVal</a>(TCPWM0, MY_TCPWM_GRP1_CNT0_NUM, compareBuf1);</div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga9fd998d3efb783d7ab9c11b28d48d1a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9fd998d3efb783d7ab9c11b28d48d1a5">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_GetCompare1BufVal()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_TCPWM_Counter_GetCompare1BufVal </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> const *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the buffered compare1 value. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Buffered compare1 value.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is a need to modify the alternative compare value</span></div><div class="line"><span class="comment">     * (Compare 1) for the first (index = 256) counter of Group 1 of the TCPWM0 block.</span></div><div class="line"><span class="comment">     * Note: the counter should run in the Compare Mode.</span></div><div class="line"><span class="comment">     * Note: the compare swapping feature should be enabled.</span></div><div class="line"><span class="comment">     */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_GRP1_CNT0_NUM   (256UL)</span></div><div class="line"></div><div class="line">    <span class="comment">/* Get the currently existing Compare 1 value and set a new Compare 1 Val */</span></div><div class="line">    uint32_t compare1 = <a class="code" href="group__group__tcpwm__functions__counter.html#gab75b0a611500713330b7bd215e6e071c">Cy_TCPWM_Counter_GetCompare1Val</a>(TCPWM0, MY_TCPWM_GRP1_CNT0_NUM);</div><div class="line">    <span class="comment">/* Modify the compare value here */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#gaaee822611af74de157e5e2ec64e9eda8">Cy_TCPWM_Counter_SetCompare1Val</a>(TCPWM0, MY_TCPWM_GRP1_CNT0_NUM, compare1);</div><div class="line"></div><div class="line">    <span class="comment">/* Get the currently existing Compare1Buf value and set a new Compare1Buf Val */</span></div><div class="line">    uint32_t compareBuf1 = <a class="code" href="group__group__tcpwm__functions__counter.html#ga9fd998d3efb783d7ab9c11b28d48d1a5">Cy_TCPWM_Counter_GetCompare1BufVal</a>(TCPWM0, MY_TCPWM_GRP1_CNT0_NUM);</div><div class="line">    <span class="comment">/* Modify the compare1Buff value here */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#ga657f6b89036053674b03e52f58ded440">Cy_TCPWM_Counter_SetCompare1BufVal</a>(TCPWM0, MY_TCPWM_GRP1_CNT0_NUM, compareBuf1);</div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gaaee822611af74de157e5e2ec64e9eda8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaee822611af74de157e5e2ec64e9eda8">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_SetCompare1Val()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_TCPWM_Counter_SetCompare1Val </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>compare1</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the compare value for Compare1 when the compare mode enabled. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
    <tr><td class="paramname">compare1</td><td>The Compare1 value.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is a need to modify the alternative compare value</span></div><div class="line"><span class="comment">     * (Compare 1) for the first (index = 256) counter of Group 1 of the TCPWM0 block.</span></div><div class="line"><span class="comment">     * Note: the counter should run in the Compare Mode.</span></div><div class="line"><span class="comment">     * Note: the compare swapping feature should be enabled.</span></div><div class="line"><span class="comment">     */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_GRP1_CNT0_NUM   (256UL)</span></div><div class="line"></div><div class="line">    <span class="comment">/* Get the currently existing Compare 1 value and set a new Compare 1 Val */</span></div><div class="line">    uint32_t compare1 = <a class="code" href="group__group__tcpwm__functions__counter.html#gab75b0a611500713330b7bd215e6e071c">Cy_TCPWM_Counter_GetCompare1Val</a>(TCPWM0, MY_TCPWM_GRP1_CNT0_NUM);</div><div class="line">    <span class="comment">/* Modify the compare value here */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#gaaee822611af74de157e5e2ec64e9eda8">Cy_TCPWM_Counter_SetCompare1Val</a>(TCPWM0, MY_TCPWM_GRP1_CNT0_NUM, compare1);</div><div class="line"></div><div class="line">    <span class="comment">/* Get the currently existing Compare1Buf value and set a new Compare1Buf Val */</span></div><div class="line">    uint32_t compareBuf1 = <a class="code" href="group__group__tcpwm__functions__counter.html#ga9fd998d3efb783d7ab9c11b28d48d1a5">Cy_TCPWM_Counter_GetCompare1BufVal</a>(TCPWM0, MY_TCPWM_GRP1_CNT0_NUM);</div><div class="line">    <span class="comment">/* Modify the compare1Buff value here */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#ga657f6b89036053674b03e52f58ded440">Cy_TCPWM_Counter_SetCompare1BufVal</a>(TCPWM0, MY_TCPWM_GRP1_CNT0_NUM, compareBuf1);</div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga657f6b89036053674b03e52f58ded440"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga657f6b89036053674b03e52f58ded440">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_SetCompare1BufVal()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_TCPWM_Counter_SetCompare1BufVal </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>compareBuf1</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the buffered compare value for Compare1 when the compare mode enabled. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
    <tr><td class="paramname">compareBuf1</td><td>The buffered Compare1 value.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is a need to modify the alternative compare value</span></div><div class="line"><span class="comment">     * (Compare 1) for the first (index = 256) counter of Group 1 of the TCPWM0 block.</span></div><div class="line"><span class="comment">     * Note: the counter should run in the Compare Mode.</span></div><div class="line"><span class="comment">     * Note: the compare swapping feature should be enabled.</span></div><div class="line"><span class="comment">     */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_GRP1_CNT0_NUM   (256UL)</span></div><div class="line"></div><div class="line">    <span class="comment">/* Get the currently existing Compare 1 value and set a new Compare 1 Val */</span></div><div class="line">    uint32_t compare1 = <a class="code" href="group__group__tcpwm__functions__counter.html#gab75b0a611500713330b7bd215e6e071c">Cy_TCPWM_Counter_GetCompare1Val</a>(TCPWM0, MY_TCPWM_GRP1_CNT0_NUM);</div><div class="line">    <span class="comment">/* Modify the compare value here */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#gaaee822611af74de157e5e2ec64e9eda8">Cy_TCPWM_Counter_SetCompare1Val</a>(TCPWM0, MY_TCPWM_GRP1_CNT0_NUM, compare1);</div><div class="line"></div><div class="line">    <span class="comment">/* Get the currently existing Compare1Buf value and set a new Compare1Buf Val */</span></div><div class="line">    uint32_t compareBuf1 = <a class="code" href="group__group__tcpwm__functions__counter.html#ga9fd998d3efb783d7ab9c11b28d48d1a5">Cy_TCPWM_Counter_GetCompare1BufVal</a>(TCPWM0, MY_TCPWM_GRP1_CNT0_NUM);</div><div class="line">    <span class="comment">/* Modify the compare1Buff value here */</span></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#ga657f6b89036053674b03e52f58ded440">Cy_TCPWM_Counter_SetCompare1BufVal</a>(TCPWM0, MY_TCPWM_GRP1_CNT0_NUM, compareBuf1);</div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gae8e864267855dd674d618bba19733ce3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae8e864267855dd674d618bba19733ce3">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_EnableCompare1Swap()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_TCPWM_Counter_EnableCompare1Swap </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enables the comparison swap of compare1 and compareBuf1 when the comparison value is true. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
    <tr><td class="paramname">enable</td><td>true = swap enabled; false = swap disabled</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: there is a need to enable the compare swapping feature for</span></div><div class="line"><span class="comment">     * the first (index = 256) counter of Group 1 of TCPWM0 block.</span></div><div class="line"><span class="comment">     */</span></div><div class="line"><span class="preprocessor">    #define MY_TCPWM_GRP1_CNT0_NUM   (256UL)</span></div><div class="line"></div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#gae8e864267855dd674d618bba19733ce3">Cy_TCPWM_Counter_EnableCompare1Swap</a>(TCPWM0, MY_TCPWM_GRP1_CNT0_NUM, <span class="keyword">true</span>);</div><div class="line">    <span class="comment">/* Now the Compare1Val and Compare1BufVal values can be swapped using Cy_TCPWM_TriggerCapture1 */</span></div></div><!-- fragment --> </dd></dl>
<dl class="section note"><dt>Note</dt><dd>From Version 3 of TCPWM, this feature is coupled with the swap enable feature (<a class="el" href="group__group__tcpwm__functions__counter.html#ga2abece06e0b8d5fe890886ad883e7a41" title="Enables/disables swapping mechanism between CC0 and buffered CC0, CC1 and buffered CC1...">Cy_TCPWM_Counter_EnableSwap()</a>). when both reload and swap are enabled then CC1 value is swapped with CC1 buff value. When only reload is enabled then CC1 buff value is copied to CC1. There is no action when reload is disabled. </dd></dl>

</div>
</div>
<a id="ga2abece06e0b8d5fe890886ad883e7a41"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2abece06e0b8d5fe890886ad883e7a41">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_EnableSwap()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_TCPWM_Counter_EnableSwap </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enables/disables swapping mechanism between CC0 and buffered CC0, CC1 and buffered CC1, PERIOD and buffered PERIOD, DT and buffered DT. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
    <tr><td class="paramname">enable</td><td>true = swap enabled; false = swap disabled</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>This feature is coupled with the reload feature. when both reload and swap are enabled then CC0/CC1/PERIOD/DT values are swapped with CC_BUFF/CC1_BUFF/PERIOD_BUFF/DT_BUFF values respectively When only reload is enabled then CC_BUFF/CC1_BUFF/PERIOD_BUFF/DT_BUFF values are copied to CC0/CC1/PERIOD/DT respectively. There is no action when reload is disabled. </dd></dl>

</div>
</div>
<a id="gaee3f140d6da2342b0bfb26f629a98ddf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaee3f140d6da2342b0bfb26f629a98ddf">&#9670;&nbsp;</a></span>Cy_TCPWM_Counter_SetDirection_Change_Mode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_TCPWM_Counter_SetDirection_Change_Mode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_c_p_w_m___type.html">TCPWM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cntNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__tcpwm__data__structures__counter.html#ga911ca130e2c8ca40b252bd1f7b78c3e5">cy_en_counter_direction_t</a>&#160;</td>
          <td class="paramname"><em>direction_mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Direction change mode Based on falling/rising edge of capture0 input. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a TCPWM instance.</td></tr>
    <tr><td class="paramname">cntNum</td><td>The Counter instance number in the selected TCPWM.</td></tr>
    <tr><td class="paramname">direction_mode</td><td>Direction change mode Based on falling/rising edge of capture0 input <a class="el" href="group__group__tcpwm__data__structures__counter.html#ga911ca130e2c8ca40b252bd1f7b78c3e5">cy_en_counter_direction_t</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>For TCPWM version 3 and above in compare mode, when external direction control is enabled and Capture0 input is disabled, user can use software capture0 trigger. While using this, User has to make sure that the external direction control is set to CY_TCPWM_COUNTER_DIRECTION_RISING </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
